//
//  LXNetworkOperation.h
//  ProjectSource_Demo
//
//  Created by Liu on 16/2/18.
//  Copyright © 2016年 AngryBear. All rights reserved.
//

#import <Foundation/Foundation.h>

@class LXNetworkOperation;
typedef void (^CompletionBlock)(LXNetworkOperation *operation, NSDictionary *response);
typedef void (^FailureBlock)(LXNetworkOperation *operation, NSError *error);

@interface LXNetworkOperation : NSOperation

@property (nonatomic, strong) NSURL *url;
@property (nonatomic, strong) NSURLRequest *request;
@property (nonatomic, strong) CompletionBlock completion;
@property (nonatomic, strong) FailureBlock failure;

+ (instancetype)HTTPRequestOperationWithRequest:(NSURLRequest *)request
                                     params:(NSDictionary *)params
                              completionHandler:(void (^)())completion
                                 failureHandler:(void (^)())failure;

@end
